package com.xxx.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxx.mapper.PackageMapper;
import com.xxx.pojo.Package;
import com.xxx.service.PackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PackageServiceImpl extends ServiceImpl<PackageMapper, Package> implements PackageService {

    @Autowired
    PackageMapper mapper;

    @Override
    public int updateStatus(Integer status, List<Long> ids) {
        LambdaUpdateWrapper<Package> luw = new LambdaUpdateWrapper<>();
        luw.set(Package::getStatus,status).in(Package::getCode,ids);
        int update = mapper.update(null,luw);

        return update;
    }
}
